/*
 * @Description: 
 * @Author: ZhangHan
 * @Date: 2025-04-23 14:27:25
 * @LastEditTime: 2025-04-25 21:21:06
 * @LastEditors: Zhanghan
 */
import { TableColumnType, Tag, Flex } from "antd";
import { SEX_VALUE } from "@/concacts/valueEnum";
import { ProEllipsis } from "@/components/ProComponents/index";

const align = "center";

const columns: TableColumnType[] = [
  {
    title: "姓名",
    dataIndex: "name",
    key: "name",
    align,
    width: 80,
  },
  {
    title: "年龄",
    dataIndex: "age",
    key: "age",
    align,
    width: 80,
  },
  {
    title: "性别",
    dataIndex: "sex",
    key: "sex",
    align,
    width: 100,
    render: (value) => {
      return SEX_VALUE[value]?.text;
    },
  },
  {
    title: "爱好",
    dataIndex: "happit",
    key: "happit",
    align,
    width: 220,
  },
  {
    title: "住址",
    dataIndex: "address",
    key: "address",
    align,
    width: 200,
    render: (value) => {
      return <ProEllipsis text={value} maxWidth={200} copyable={true} />;
    },
  },
  {
    title: "标签栏",
    dataIndex: "tags",
    key: "tags",
    align,
    width: 300,
    render: (value) => {
      return (
        <Flex gap="4px 0" wrap>
          {value.map((item) => (
            <Tag key={item} color="success">{item}</Tag>
          ))}
        </Flex>
      );
    },
  },
];

export default columns;
